package com.yyh.io2;

import java.io.*;

/*复制文件*/
public class Test5 {
    public static void main(String[] args) throws IOException {
        //创建输入输出流对象
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D:\\ideaproject\\IO-code\\IO-code-02\\src\\com\\yyh\\file\\aa.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("D:\\ideaproject\\IO-code\\IO-code-02\\src\\com\\yyh\\file\\b.txt"));
        //打开水龙头，开始读，写
        byte[] car = new byte[1024];
        int len;
        while ((len = bis.read(car)) != -1){
            bos.write(car,0,len);
        }
        //关闭水龙头
        bis.close();
        bos.close();
    }
}
